import math
game = 'outputHist'
f = open(game, 'r')
res = {'Blue':[], 'Red':[]}
for l in f.readlines():
    r = l.split(': ')
    if len(r) > 1:
       res[r[0]].append(int(r[1]))
f.close()
wins = 0
for i in range(len(res['Blue'])):
    if res['Blue'][i] > res['Red'][i]:
        wins += 1
print game
print 'Games',len(res['Blue'])
print 'Wins',wins,'Ratio:', float(wins)/len(res['Blue'])
avgBlue = (float(sum(res['Blue']))/len(res['Blue']))
avgRed = (float(sum(res['Red']))/len(res['Red']))
print 'Average scores: Blue-',avgBlue,'Red-',avgRed

stdRed = 0
stdBlue = 0
for i in range(len(res['Red'])):
    stdRed += float((res['Red'][i] - avgRed) ** 2)/len(res['Red'])
    stdBlue += float((res['Blue'][i] - avgBlue) ** 2)/len(res['Blue'])
print 'StdDevs: Blue-',math.sqrt(stdBlue),'Red-',math.sqrt(stdRed)
print '\n\n'